package com.rj.core.domain;

import com.rj.core.constant.DateFormat;
import com.rj.core.constant.DigitsEnum;
import com.rj.core.constant.RegexpPool;
import com.rj.core.validation.constraints.DateField;
import com.rj.core.validation.constraints.DigitsField;
import com.rj.core.validation.constraints.NumberField;
import com.rj.core.validation.constraints.StringField;
import jakarta.validation.constraints.NotEmpty;
import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * 数据处理Map
 *
 * @author YFX_RANLUBO
 * @date 2022/10/20 17:11
 **/
@Data
public class BeanDomain2 {
    @StringField(value = "标题", empty = false, maxLen = 10)
    private String title;
    @StringField(value = "类型", empty = false, dict = {"1", "2"})
    private String type;
    @NumberField(value = "年龄", empty = false, min = "1", max = "100")
    public Integer age;

    @NumberField(value = "金额", empty = false, regexp = RegexpPool.MONEY)
    @DigitsField(value = "金额", empty = false, maxInteger = 8, maxFraction = 2,
            digitsEnum = DigitsEnum.ANY)
    private String je;

    @NotEmpty(message = "list不能为空")
    List<BeanDomain2> lists = new ArrayList<>();
    private String name;

    @DateField(value = "生日", dateFormat = {DateFormat.YYYY_MM_DD, DateFormat.YYYY_MM_DD_G
            , DateFormat.YYYYMM, DateFormat.YYYY_MM})
    private String birthDate;

}
